package com.txx.design.principles.openclose;

public class JavaDiscountPrice extends JavaCourse{

    public JavaDiscountPrice(int id, double price, String name) {
        super(id, price, name);
    }

    public double getOriginPrice(){
        return super.getPrice();
    }
    //通过重写父类方法来满足需求而不影响之前的底层类
    @Override
    public double getPrice() {
        return super.getPrice() * 0.8;
    }
}
